package com.mi.rof.rocketmq.producer;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author : Yang Yu you
 */
@Component
public class MyProducer {

    @Resource
    private RocketMQTemplate rocketMQTemplate;

    public void sendMessage(String topic, String message){
        rocketMQTemplate.convertAndSend(topic, message);
    }
}
